﻿using FrameworkCore.Data;
using Microsoft.EntityFrameworkCore;
using Application.Commons.Extensions;
using System.Reflection;
using FrameworkCore.Migrations.Data;

namespace Application.Commons.Data;

public partial class ApplicationDbContext : HookingDbContext
{
    public ApplicationDbContext(DbContextOptions<ApplicationDbContext> options) : base(options)
    {
    }

    protected override void OnModelCreating(ModelBuilder builder)
    {

        base.OnModelCreating(builder);
        builder.ApplyConfigurationsFromAssembly(Assembly.GetExecutingAssembly());
        builder.ApplyGlobalFilters<ISoftDeleted>(s => s.Deleted == null);
    }

    protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
    {

    }
}
